import {
    BrowserRouter as Router,
    Routes,
    Route,
} from 'react-router-dom'
import App from '../App'
import { routes } from './routes.jsx'

// import Home from '../page/home'
// import Resource from '../page/home/resource'
// import Broadcast from '../page/home/broadcast'
// import Group from '../page/home/group'
// import Examine from '../page/home/examine'
// import Order from '../page/home/order'
// import Help from '../page/home/help'
// import Agent from '../page/home/agent'
// import Login from '../page/login'

const RouterView = () => {
    return (
        <Router>
            <App>
                <Routes>
                    {
                        routes.map(item => {
                            return <Route key={item.path} path={item.path} element={item.element}>
                                {
                                    item.children?.map(item1 => {
                                        return <Route key={item1.path} path={item1.path} element={item1.element} />
                                    })
                                }

                            </Route>
                        })
                    }

                    {/* <Route path='/resource' element={<Resource />} />
                    <Route path='/broadcast' element={<Broadcast />} />
                    <Route path='/group' element={<Group />} />
                    <Route path='/examine' element={<Examine />} />
                    <Route path='/order' element={<Order />} />
                    <Route path='/help' element={<Help />} />
                    <Route path='/agent' element={<Agent />} /> */}
                </Routes>
            </App>
        </Router>
    )
}

export default RouterView